# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-ujson
pkgver=5.4.0
pkgrel=0
pkgdesc="Fast Python JSON encoder and decoder"
url="https://github.com/ultrajson/ultrajson"
arch="all"
license="BSD-3-Clause"
makedepends="
	py3-setuptools
	py3-setuptools_scm
	python3-dev
	"
checkdepends="
	py3-pytest
	py3-tz
	"
source="https://pypi.io/packages/source/u/ujson/ujson-$pkgver.tar.gz"
builddir="$srcdir/ujson-$pkgver"

# secfixes:
#   5.4.0-r0:
#     - CVE-2022-31116
#     - CVE-2022-31117
#   5.2.0-r0:
#     - CVE-2021-45958

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$(echo $PWD/build/lib.*)" python3 tests/test_ujson.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
9622e872391d5467455b32e324d7b680487664ca486bfc56ba8c3969853e5db94725cd45e81b535dca80af4a3c718af171ce7adb6dcb9b98a37a8068824f89c6  ujson-5.4.0.tar.gz
"
